package com.wulian.user.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 *@Description:(用户实体包含政府人员)
 * @author  caifulin
 * @date  2020/4/21 18:24
 * @version 1.0
 */
@Data
@TableName("sys_user")
@ApiModel("用户表")
@ToString
public class SysUser extends Model<SysUser> {

    @ApiModelProperty("主键id")
    @TableId(value = "user_id",type = IdType.AUTO)
    private Integer userId;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("password")
    private String password;

    @ApiModelProperty("随机盐")
    private String salt;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("当前机构id")
    private Integer deptId;

    @ApiModelProperty("企业id")
    private Integer companyId;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("修改时间")
    private Date updateTime;

    @ApiModelProperty("0-正常，1-删除")
    private Integer delFlag;

    @ApiModelProperty("e-mail")
    private String email;

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("工号")
    private String workNumber;

    @ApiModelProperty("状态0.启用1.停用")
    private Integer status;

    @ApiModelProperty("用户类型 0 企业管理员 1，普通员工")
    private String userType;

    @ApiModelProperty("省-政府人员独特拥有")
    private Integer province;

    @ApiModelProperty("市-政府人员独特拥有")
    private Integer city;

    @ApiModelProperty("县-政府人员独特拥有")
    private Integer county;

    @ApiModelProperty("角色id")
    @TableField(exist = false)
    private Integer[] roleId;

    @ApiModelProperty("人员当前机构id及下辖机构Id")
    @TableField(exist = false)
    private List<Integer> deptIdList;

    @ApiModelProperty("直属领导id")
    private Integer parentId;


    public SysUser() {
    }

    @Override
    protected Serializable pkVal() {
        return null;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}